package com.eastjet.maintenance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 关联设备
 * @TableName associated_devices
 */
@TableName(value ="associated_devices")
@Data
public class AssociatedDevices implements Serializable {
    /**
     * 关联设备主键id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 关联台账编码
     */
    private String code;

    /**
     * 设备编号
     */
    private String devicenumber;

    /**
     * 设备名称
     */
    private String name;

    /**
     * 规格型号
     */
    private String specification;

    /**
     * 设备类型
     */
    private String deviceType;

    /**
     * 品牌
     */
    private String brand;

    /**
     * 使用部门
     */
    private String useDepartments;

    /**
     * 存放位置
     */
    private String storageLocation;

    /**
     * 设备状态
     */
    private String deviceStatus;

    /**
     * 设备部位
     */
    private String equipmentParts;

    /**
     * 关联数量
     */
    private Integer associatedQuantity;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date creationTime;

    /**
     * 更新人
     */
    private String updater;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updated;

    /**
     * 逻辑删除
     */
    private Integer tombstone;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AssociatedDevices other = (AssociatedDevices) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
            && (this.getDevicenumber() == null ? other.getDevicenumber() == null : this.getDevicenumber().equals(other.getDevicenumber()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getSpecification() == null ? other.getSpecification() == null : this.getSpecification().equals(other.getSpecification()))
            && (this.getDeviceType() == null ? other.getDeviceType() == null : this.getDeviceType().equals(other.getDeviceType()))
            && (this.getBrand() == null ? other.getBrand() == null : this.getBrand().equals(other.getBrand()))
            && (this.getUseDepartments() == null ? other.getUseDepartments() == null : this.getUseDepartments().equals(other.getUseDepartments()))
            && (this.getStorageLocation() == null ? other.getStorageLocation() == null : this.getStorageLocation().equals(other.getStorageLocation()))
            && (this.getDeviceStatus() == null ? other.getDeviceStatus() == null : this.getDeviceStatus().equals(other.getDeviceStatus()))
            && (this.getEquipmentParts() == null ? other.getEquipmentParts() == null : this.getEquipmentParts().equals(other.getEquipmentParts()))
            && (this.getAssociatedQuantity() == null ? other.getAssociatedQuantity() == null : this.getAssociatedQuantity().equals(other.getAssociatedQuantity()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
            && (this.getCreationTime() == null ? other.getCreationTime() == null : this.getCreationTime().equals(other.getCreationTime()))
            && (this.getUpdater() == null ? other.getUpdater() == null : this.getUpdater().equals(other.getUpdater()))
            && (this.getUpdated() == null ? other.getUpdated() == null : this.getUpdated().equals(other.getUpdated()))
            && (this.getTombstone() == null ? other.getTombstone() == null : this.getTombstone().equals(other.getTombstone()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getDevicenumber() == null) ? 0 : getDevicenumber().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getSpecification() == null) ? 0 : getSpecification().hashCode());
        result = prime * result + ((getDeviceType() == null) ? 0 : getDeviceType().hashCode());
        result = prime * result + ((getBrand() == null) ? 0 : getBrand().hashCode());
        result = prime * result + ((getUseDepartments() == null) ? 0 : getUseDepartments().hashCode());
        result = prime * result + ((getStorageLocation() == null) ? 0 : getStorageLocation().hashCode());
        result = prime * result + ((getDeviceStatus() == null) ? 0 : getDeviceStatus().hashCode());
        result = prime * result + ((getEquipmentParts() == null) ? 0 : getEquipmentParts().hashCode());
        result = prime * result + ((getAssociatedQuantity() == null) ? 0 : getAssociatedQuantity().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
        result = prime * result + ((getUpdater() == null) ? 0 : getUpdater().hashCode());
        result = prime * result + ((getUpdated() == null) ? 0 : getUpdated().hashCode());
        result = prime * result + ((getTombstone() == null) ? 0 : getTombstone().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", code=").append(code);
        sb.append(", devicenumber=").append(devicenumber);
        sb.append(", name=").append(name);
        sb.append(", specification=").append(specification);
        sb.append(", deviceType=").append(deviceType);
        sb.append(", brand=").append(brand);
        sb.append(", useDepartments=").append(useDepartments);
        sb.append(", storageLocation=").append(storageLocation);
        sb.append(", deviceStatus=").append(deviceStatus);
        sb.append(", equipmentParts=").append(equipmentParts);
        sb.append(", associatedQuantity=").append(associatedQuantity);
        sb.append(", remark=").append(remark);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", creationTime=").append(creationTime);
        sb.append(", updater=").append(updater);
        sb.append(", updated=").append(updated);
        sb.append(", tombstone=").append(tombstone);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}